package com.bootmy.Service.Impl;

import com.bootmy.Service.DictService;
import com.bootmy.dao.DictDao;
import com.bootmy.mapper.DictMapper;
import com.bootmy.model.Dict;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DictServiceImpl implements DictService {

    @Resource
    DictMapper dictMapper;

    @Resource
    DictDao dictDao;

    @Override
    public Dict findUserById(Long id) {
        Dict dict = new Dict();
        try {
            dict  = dictMapper.selectByPrimaryKey(id);
        }catch (Exception e){
            e.printStackTrace();
        }
        return dict;
    }

    @Override
    public List<Dict> findAllUser() {
        List<Dict> userList = dictMapper.findAllUser();
        System.out.println("数组长度为："+userList.size());
        return userList;
    }
    @Override
    public List<Dict> findAllUserDao() {
        List<Dict> userList = dictMapper.findAllUser();
        System.out.println("数组长度为："+userList.size());
        return userList;
    }
}
